/* ================================================
   THIEN GLOBAL v2 — Professional Design System
   Palette: Deep Slate (#0f172a) + Emerald (#10b981)
   + Off-white text — Clean, corporate, modern
   ================================================ */

:root {
    --em:        #10b981;        /* emerald accent */
    --em-dark:   #059669;
    --em-light:  #6ee7b7;
    --em-faint:  rgba(16,185,129,.08);
    --em-border: rgba(16,185,129,.2);

    --bg:        #0f172a;        /* deep navy-slate */
    --bg-2:      #1e293b;        /* surface */
    --bg-3:      #334155;        /* elevated */
    --bg-card:   #1e293b;

    --text:      #f1f5f9;
    --text-2:    #94a3b8;
    --text-3:    #475569;

    --border:    rgba(255,255,255,.07);
    --radius:    14px;
    --r-sm:      8px;
    --r-xl:      22px;

    --ff-sans:   'Outfit', sans-serif;
    --ff-serif:  'Playfair Display', Georgia, serif;

    --ease:      cubic-bezier(.4,0,.2,1);
    --t:         0.28s;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--ff-sans);
    font-weight: 400;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ──────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--em); }

/* ── Loader ─────────────────────── */
.loader-wrap {
    position: fixed; inset: 0; z-index: 9999;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    transition: opacity .5s var(--ease);
}
.loader-logo { width: 64px; height: 64px; }

/* ── Scroll Top ─────────────────── */
.scroll-top {
    position: fixed; bottom: 28px; right: 28px; z-index: 999;
    width: 42px; height: 42px;
    background: var(--em); color: #fff;
    border: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; cursor: pointer;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: all var(--t) var(--ease);
    box-shadow: 0 4px 20px rgba(16,185,129,.35);
}
.scroll-top.visible { opacity: 1; visibility: visible; pointer-events: auto; }
.scroll-top:hover { background: var(--em-dark); transform: translateY(-3px); }

/* ================================================
   HEADER
   ================================================ */
.site-header {
    position: sticky; top: 0; z-index: 1000;
    padding: 0;
    transition: background var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.site-header.scrolled {
    background: rgba(15,23,42,.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 0;
    gap: 24px;
}

.nav-logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; flex-shrink: 0;
}
.logo-icon {
    width: 38px; height: 38px;
    background: var(--em);
    color: #fff;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .9rem;
    letter-spacing: .03em;
    flex-shrink: 0;
}
.logo-text {
    font-size: 1.15rem; font-weight: 700;
    color: var(--text); letter-spacing: -.02em;
}

.nav-toggle {
    display: none;
    flex-direction: column; gap: 5px;
    background: none; border: 1px solid var(--border);
    border-radius: var(--r-sm); padding: 9px 11px; cursor: pointer;
}
.nav-toggle span {
    display: block; width: 18px; height: 1.5px;
    background: var(--text-2); border-radius: 2px;
    transition: var(--t) var(--ease);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-links {
    display: flex; align-items: center; gap: 4px;
    list-style: none;
}
.nav-link {
    display: block; padding: 7px 13px;
    font-size: .85rem; font-weight: 500;
    color: var(--text-2);
    text-decoration: none;
    border-radius: var(--r-sm);
    transition: color var(--t) var(--ease), background var(--t) var(--ease);
}
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--border); }
.nav-link.active { color: var(--em); }

.nav-btn {
    display: inline-block; padding: 8px 20px;
    background: var(--em); color: #fff;
    font-size: .85rem; font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: background var(--t) var(--ease), transform var(--t) var(--ease);
    margin-left: 8px;
}
.nav-btn:hover { background: var(--em-dark); transform: translateY(-1px); color: #fff; }

/* ================================================
   HERO
   ================================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex; align-items: center;
    padding: 120px 0 80px;
    overflow: hidden;
}

.hero-canvas {
    position: absolute; inset: 0; pointer-events: none;
}

/* Soft blobs */
.hero-blob {
    position: absolute; border-radius: 50%;
    filter: blur(100px);
}
.blob-1 {
    width: 520px; height: 520px;
    background: rgba(16,185,129,.12);
    top: -120px; left: -120px;
}
.blob-2 {
    width: 400px; height: 400px;
    background: rgba(14,165,233,.08);
    bottom: -80px; right: 10%;
}
.blob-3 {
    width: 300px; height: 300px;
    background: rgba(16,185,129,.06);
    top: 40%; right: -60px;
}

/* Horizontal grid lines */
.hero-lines {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    justify-content: space-evenly;
}
.hline {
    width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.04) 30%, rgba(255,255,255,.04) 70%, transparent 100%);
}

.hero-content { max-width: 680px; position: relative; z-index: 2; }

.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--em-faint);
    border: 1px solid var(--em-border);
    color: var(--em-light);
    font-size: .75rem; font-weight: 600;
    letter-spacing: .06em; text-transform: uppercase;
    padding: 7px 14px; border-radius: 50px;
    margin-bottom: 28px;
    animation: fadeSlideUp .7s var(--ease) both;
}
.badge-dot {
    width: 6px; height: 6px;
    background: var(--em);
    border-radius: 50%;
    animation: blink 2s ease infinite;
}
@keyframes blink {
    0%,100% { opacity:1; }
    50% { opacity:.3; }
}

.hero-headline {
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 800;
    line-height: 1.08;
    color: var(--text);
    letter-spacing: -.03em;
    margin-bottom: 24px;
    animation: fadeSlideUp .7s .1s var(--ease) both;
}
.headline-accent {
    color: var(--em);
    font-family: var(--ff-serif);
    font-style: italic;
    font-weight: 600;
}

.hero-body {
    font-size: 1.1rem; font-weight: 300; line-height: 1.75;
    color: var(--text-2); max-width: 540px;
    margin-bottom: 40px;
    animation: fadeSlideUp .7s .2s var(--ease) both;
}

.hero-cta {
    display: flex; flex-wrap: wrap; gap: 12px;
    animation: fadeSlideUp .7s .3s var(--ease) both;
}

.cta-primary {
    display: inline-flex; align-items: center;
    padding: 13px 30px;
    background: var(--em); color: #fff;
    font-size: .9rem; font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: background var(--t), transform var(--t), box-shadow var(--t);
    box-shadow: 0 0 0 0 rgba(16,185,129,.4);
}
.cta-primary:hover {
    background: var(--em-dark); color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(16,185,129,.3);
}

.cta-outline {
    display: inline-flex; align-items: center;
    padding: 13px 30px;
    background: transparent; color: var(--text-2);
    font-size: .9rem; font-weight: 500;
    border: 1px solid var(--border);
    border-radius: 50px;
    text-decoration: none;
    transition: all var(--t);
}
.cta-outline:hover { border-color: var(--em); color: var(--em); }

/* Stats row */
.hero-stats {
    display: flex; align-items: center; gap: 0;
    margin-top: 64px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 20px 32px;
    width: fit-content;
    animation: fadeSlideUp .7s .4s var(--ease) both;
}
.stat-pill { text-align: center; padding: 0 24px; }
.stat-n {
    display: block;
    font-size: 1.6rem; font-weight: 800;
    color: var(--em); line-height: 1;
    margin-bottom: 4px;
}
.stat-l {
    font-size: .7rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: .1em;
    color: var(--text-3);
}
.stat-divider {
    width: 1px; height: 36px;
    background: var(--border);
    flex-shrink: 0;
}

/* ================================================
   TICKER
   ================================================ */
.ticker-wrap {
    overflow: hidden;
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 13px 0;
}
.ticker-track {
    display: flex; align-items: center; gap: 20px;
    width: max-content;
    animation: ticker 28s linear infinite;
    white-space: nowrap;
}
@keyframes ticker {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
.ticker-track span {
    font-size: .78rem; font-weight: 500;
    letter-spacing: .08em; text-transform: uppercase;
    color: var(--text-3);
}
.ticker-track i {
    color: var(--em); font-size: .35rem;
    flex-shrink: 0;
}

/* ================================================
   APPS SECTION
   ================================================ */
.apps-section {
    padding: 100px 0 120px;
    background: var(--bg);
}

.sec-label {
    font-size: .7rem; font-weight: 700;
    letter-spacing: .2em; text-transform: uppercase;
    color: var(--em);
    margin-bottom: 12px;
}
.sec-head {
    display: flex; justify-content: space-between;
    align-items: flex-end; flex-wrap: wrap; gap: 16px;
    margin-bottom: 56px;
}
.sec-head h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800; letter-spacing: -.03em;
    color: var(--text); line-height: 1.1;
}
.sec-head p {
    font-size: .95rem; color: var(--text-2);
    font-weight: 300; max-width: 380px; line-height: 1.65;
}

/* ── App Card ───────────────────── */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
}

.app-card {
    display: block; text-decoration: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--t) var(--ease),
                border-color var(--t) var(--ease),
                box-shadow var(--t) var(--ease);
}
.app-card:hover {
    transform: translateY(-5px);
    border-color: rgba(16,185,129,.3);
    box-shadow: 0 20px 50px rgba(0,0,0,.4), 0 0 0 1px rgba(16,185,129,.15);
}

/* Reveal animation */
.app-card.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ease), transform .6s var(--ease), border-color var(--t), box-shadow var(--t); }
.app-card.revealed { opacity: 1; transform: translateY(0); }
.app-card.revealed:hover { transform: translateY(-5px); }

.reveal { opacity:0; transform:translateY(20px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.revealed { opacity:1; transform:none; }

/* stagger */
.app-card:nth-child(1)  { transition-delay: .04s; }
.app-card:nth-child(2)  { transition-delay: .08s; }
.app-card:nth-child(3)  { transition-delay: .12s; }
.app-card:nth-child(4)  { transition-delay: .16s; }
.app-card:nth-child(5)  { transition-delay: .20s; }
.app-card:nth-child(6)  { transition-delay: .24s; }
.app-card:nth-child(7)  { transition-delay: .28s; }
.app-card:nth-child(8)  { transition-delay: .32s; }
.app-card:nth-child(9)  { transition-delay: .36s; }
.app-card:nth-child(10) { transition-delay: .40s; }
.app-card:nth-child(11) { transition-delay: .44s; }
.app-card:nth-child(12) { transition-delay: .48s; }

.app-card-img {
    position: relative; overflow: hidden; height: 185px;
}
.app-card-img img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .5s var(--ease);
    filter: brightness(.9);
}
.app-card:hover .app-card-img img { transform: scale(1.05); filter: brightness(1); }

.app-card-img::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(15,23,42,.65) 0%, transparent 55%);
}

.app-tag {
    position: absolute; top: 12px; left: 12px; z-index: 2;
    background: var(--em); color: #fff;
    font-size: .65rem; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase;
    padding: 4px 10px; border-radius: 50px;
}
.app-tag.tag-new { background: #6366f1; }
.app-tag.tag-hot { background: #ef4444; }

.app-card-foot {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
}
.app-icon {
    width: 48px; height: 48px;
    border-radius: 11px; object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
}
.app-text { flex: 1; min-width: 0; }
.app-text h3 {
    font-size: .9rem; font-weight: 600;
    color: var(--text); margin-bottom: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-rating { display: flex; align-items: center; gap: 6px; }
.stars { color: #f59e0b; font-size: .75rem; }
.rcount { font-size: .7rem; color: var(--text-3); }

.app-arrow {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-3); font-size: 1rem;
    transition: color var(--t), transform var(--t);
    flex-shrink: 0;
}
.app-card:hover .app-arrow { color: var(--em); transform: translate(2px,-2px); }

/* ================================================
   CONTACT STRIP
   ================================================ */
.contact-strip {
    padding: 80px 0;
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.contact-strip-inner {
    display: flex; justify-content: space-between;
    align-items: center; flex-wrap: wrap; gap: 32px;
}
.strip-label {
    font-size: .7rem; font-weight: 700;
    letter-spacing: .18em; text-transform: uppercase;
    color: var(--em); margin-bottom: 8px;
}
.strip-title {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 800; color: var(--text);
    letter-spacing: -.03em; line-height: 1.15;
}

/* ================================================
   FOOTER
   ================================================ */
.site-footer {
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    padding: 70px 0 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 52px;
}
.footer-logo {
    display: inline-flex; align-items: center; gap: 10px;
    text-decoration: none; margin-bottom: 18px;
}
.footer-tagline {
    font-size: .875rem; color: var(--text-3);
    line-height: 1.75; font-weight: 300; max-width: 280px;
}
.footer-heading {
    font-size: .65rem; font-weight: 700;
    letter-spacing: .18em; text-transform: uppercase;
    color: var(--em); margin-bottom: 18px;
}
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 9px; }
.footer-links a {
    font-size: .875rem; color: var(--text-3);
    text-decoration: none;
    transition: color var(--t);
}
.footer-links a:hover { color: var(--text); }
.footer-bar {
    display: flex; justify-content: space-between;
    align-items: center; flex-wrap: wrap; gap: 12px;
    padding: 20px 0;
    border-top: 1px solid var(--border);
}
.footer-bar p { font-size: .8rem; color: var(--text-3); margin: 0; }
.footer-bar-links { display: flex; gap: 20px; }
.footer-bar-links a { font-size: .8rem; color: var(--text-3); text-decoration: none; transition: color var(--t); }
.footer-bar-links a:hover { color: var(--em); }

/* ================================================
   ANIMATIONS
   ================================================ */
@keyframes fadeSlideUp {
    from { opacity:0; transform:translateY(22px); }
    to   { opacity:1; transform:translateY(0); }
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand-col { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .nav-links {
        display: none;
        position: absolute; top: 100%; left: 0; right: 0;
        background: rgba(15,23,42,.97);
        backdrop-filter: blur(20px);
        flex-direction: column; align-items: stretch;
        padding: 16px;
        border-bottom: 1px solid var(--border);
        gap: 4px;
    }
    .nav-links.open { display: flex; }
    .nav-btn { margin-left: 0; text-align: center; border-radius: var(--r-sm); }

    .site-header { position: sticky; }
    .nav-inner { position: relative; }

    .hero { min-height: auto; padding: 90px 0 60px; }
    .hero-stats {
        flex-wrap: wrap; gap: 0;
        padding: 16px 20px;
        width: 100%;
    }
    .stat-pill { flex: 1 1 40%; padding: 12px 0; }
    .stat-divider:nth-child(4) { display: none; }
    .stat-divider { height: 28px; }

    .sec-head { flex-direction: column; align-items: flex-start; }
    .apps-grid { grid-template-columns: 1fr; }
    .contact-strip-inner { flex-direction: column; align-items: flex-start; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .footer-bar { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    .hero-cta { flex-direction: column; }
    .cta-primary, .cta-outline { width: 100%; justify-content: center; }
}