/* ============================================================
   HINALL — Advanced Animations
   ============================================================ */

/* --- Custom Cursor --- */
.cur-dot {
    width: 8px; height: 8px;
    background: #38bdf8;
    border-radius: 50%;
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition: transform 0.08s, background 0.2s;
    mix-blend-mode: normal;
}
.cur-ring {
    width: 34px; height: 34px;
    border: 1.5px solid rgba(56,189,248,0.55);
    border-radius: 50%;
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    transition: width 0.25s, height 0.25s, border-color 0.25s, opacity 0.25s;
}
.cur-ring.hovered {
    width: 56px; height: 56px;
    border-color: rgba(129,140,248,0.7);
}
@media (hover: none) { .cur-dot, .cur-ring { display: none; } }

/* --- Hero Section --- */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: #030712;
    overflow: hidden;
    padding-top: 70px; /* nav height */
}

#hero-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.7;
}

/* Gradient blobs */
.hero-blobs { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0;
    animation: blobAppear 2s ease forwards;
}
.blob-1 {
    width: 700px; height: 700px;
    background: radial-gradient(circle, rgba(59,130,246,0.5), transparent 70%);
    top: -180px; left: -150px;
    animation: blobAppear 2s ease forwards 0.3s, blobFloat1 10s ease-in-out infinite 2.3s;
}
.blob-2 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(124,58,237,0.45), transparent 70%);
    bottom: -100px; right: -100px;
    animation: blobAppear 2s ease forwards 0.6s, blobFloat2 12s ease-in-out infinite 2.6s;
}
.blob-3 {
    width: 450px; height: 450px;
    background: radial-gradient(circle, rgba(6,182,212,0.35), transparent 70%);
    bottom: 10%; left: 35%;
    animation: blobAppear 2s ease forwards 0.9s, blobFloat3 9s ease-in-out infinite 2.9s;
}

@keyframes blobAppear {
    to { opacity: 1; }
}
@keyframes blobFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(50px, 30px) scale(1.08); }
    66%       { transform: translate(-20px, 50px) scale(0.95); }
}
@keyframes blobFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(-40px, -50px) scale(1.12); }
    66%       { transform: translate(30px, -20px) scale(0.93); }
}
@keyframes blobFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%       { transform: translate(25px, -40px) scale(1.1); }
}

/* Noise overlay */
.hero-noise {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px;
    pointer-events: none;
}

/* Hero content */
.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 80px 0 100px;
    width: 100%;
}

/* Badge */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 40px;
    padding: 7px 18px;
    margin-bottom: 36px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    backdrop-filter: blur(12px);
    opacity: 0;
    transform: translateY(16px);
    animation: fadeUp 0.9s cubic-bezier(0.16,1,0.3,1) forwards 0.4s;
}
.badge-dot {
    width: 7px; height: 7px;
    background: #22d3ee;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(34,211,238,0.6);
    animation: badgePulse 2.2s ease-in-out infinite 1.5s;
}
@keyframes badgePulse {
    0%   { box-shadow: 0 0 0 0   rgba(34,211,238,0.6); }
    70%  { box-shadow: 0 0 0 8px rgba(34,211,238,0); }
    100% { box-shadow: 0 0 0 0   rgba(34,211,238,0); }
}

/* Hero Title */
.hero-title {
    font-size: clamp(3rem, 7vw, 6.2rem);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -0.03em;
    margin-bottom: 28px;
    color: #f1f5f9;
    font-family: 'Outfit', sans-serif;
}
.title-line {
    display: block;
    opacity: 0;
    transform: translateY(44px);
    animation: fadeUp 1s cubic-bezier(0.16,1,0.3,1) forwards;
}
.title-line:nth-child(1) { animation-delay: 0.55s; }
.title-line:nth-child(2) { animation-delay: 0.70s; }
.title-line:nth-child(3) { animation-delay: 0.85s; }

.title-gradient {
    background: linear-gradient(100deg, #38bdf8 0%, #818cf8 45%, #f472b6 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeUp 1s cubic-bezier(0.16,1,0.3,1) forwards 0.85s,
               shimmer 5s linear infinite 2s;
}
@keyframes shimmer {
    0%   { background-position: 0%   center; }
    100% { background-position: 200% center; }
}

/* Hero subtitle */
.hero-subtitle {
    font-size: 1.18rem;
    color: #475569;
    max-width: 600px;
    margin: 0 auto 52px;
    line-height: 1.75;
    opacity: 0;
    animation: fadeUp 1s ease forwards 1.05s;
}

/* Hero CTAs */
.hero-ctas {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeUp 1s ease forwards 1.2s;
}

.btn-glow {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 15px 34px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(130deg, #006aff, #7c3aed);
    border-radius: 14px;
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s;
    box-shadow: 0 0 0 0 rgba(0,106,255,0.4);
    font-family: 'Inter', sans-serif;
}
.btn-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(130deg, #38bdf8, #818cf8, #f472b6);
    opacity: 0;
    transition: opacity 0.35s;
}
.btn-glow:hover { transform: translateY(-3px); box-shadow: 0 8px 40px rgba(0,106,255,0.45); }
.btn-glow:hover::after { opacity: 1; }
.btn-glow span { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; }

.btn-glass {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 15px 34px;
    font-size: 1rem;
    font-weight: 700;
    color: #94a3b8;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    text-decoration: none;
    backdrop-filter: blur(14px);
    transition: all 0.25s;
    font-family: 'Inter', sans-serif;
}
.btn-glass:hover {
    color: #f1f5f9;
    border-color: rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.08);
    transform: translateY(-3px);
}

/* Scroll mouse indicator */
.scroll-indicator {
    margin-top: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    animation: fadeUp 1s ease forwards 1.55s;
}
.scroll-indicator span {
    font-size: 0.7rem;
    color: #334155;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.scroll-mouse {
    width: 22px; height: 36px;
    border: 1.5px solid rgba(255,255,255,0.15);
    border-radius: 11px;
    display: flex;
    justify-content: center;
    padding-top: 5px;
}
.scroll-wheel {
    width: 3px; height: 7px;
    background: #38bdf8;
    border-radius: 2px;
    animation: scrollW 2s ease-in-out infinite;
    box-shadow: 0 0 6px #38bdf8;
}
@keyframes scrollW {
    0%   { transform: translateY(0); opacity: 1; }
    80%  { transform: translateY(13px); opacity: 0; }
    100% { transform: translateY(0); opacity: 0; }
}

/* Floating tech words */
.hero-floaters {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}
.floater {
    position: absolute;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(148,163,184,0.18);
    white-space: nowrap;
    font-family: 'Inter', monospace;
    animation: floaterDrift linear infinite;
}

@keyframes floaterDrift {
    0%   { transform: translateY(0)   rotate(var(--rot)); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(-120vh) rotate(var(--rot)); opacity: 0; }
}

/* ===== Fade-Up keyframe (shared) ===== */
@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Stats Strip ===== */
.stats-strip {
    background: #060b18;
    padding: 64px 0;
    border-top: 1px solid rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    position: relative;
    overflow: hidden;
}
.stats-strip::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 50%, rgba(59,130,246,0.06), transparent);
    pointer-events: none;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}
.stat-item {
    text-align: center;
    padding: 20px;
    border-right: 1px solid rgba(255,255,255,0.06);
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.stat-item:last-child { border-right: none; }
.stat-item.visible { opacity: 1; transform: translateY(0); }
.stat-item:nth-child(2).visible { transition-delay: 0.1s; }
.stat-item:nth-child(3).visible { transition-delay: 0.2s; }
.stat-item:nth-child(4).visible { transition-delay: 0.3s; }

.stat-num {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Outfit', sans-serif;
    line-height: 1;
    margin-bottom: 6px;
}
.stat-lbl {
    font-size: 0.85rem;
    color: #334155;
    letter-spacing: 0.04em;
}

/* ===== "What We Do" cards ===== */
.wwd-card {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.wwd-card.visible { opacity: 1; transform: translateY(0); }
.wwd-card:nth-child(2).visible { transition-delay: 0.12s; }
.wwd-card:nth-child(3).visible { transition-delay: 0.24s; }

/* ===== Section header reveal ===== */
.sec-header {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.sec-header.visible { opacity: 1; transform: translateY(0); }

/* ===== App cards — 3D tilt + spotlight + scroll-in ===== */
.hinall-app-card {
    position: relative;
    transform-style: preserve-3d;
    will-change: transform;
    overflow: hidden;
}
.card-spotlight {
    position: absolute;
    width: 260px; height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.07) 0%, transparent 70%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 0;
}
.hinall-app-card:hover .card-spotlight { opacity: 1; }
.hinall-app-card .hac-icon,
.hinall-app-card .hac-body,
.hinall-app-card .hac-btn { position: relative; z-index: 1; }

/* Glowing border on hover */
.hinall-app-card::before {
    content: '';
    position: absolute;
    inset: -1.5px;
    border-radius: 19px;
    background: var(--card-glow, linear-gradient(135deg,#3b82f6,#7c3aed));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.35s;
}
.hinall-app-card:hover::before { opacity: 1; }
.hinall-app-card:hover {
    border-color: transparent !important;
}

/* Scroll-in stagger for cards */
.scroll-in {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.65s cubic-bezier(0.16,1,0.3,1),
                transform 0.65s cubic-bezier(0.16,1,0.3,1);
}
.scroll-in.visible { opacity: 1; transform: translateY(0); }

/* ===== Typewriter cursor for hero sub ===== */
.typer::after {
    content: '|';
    animation: blink 0.9s step-end infinite;
    color: #38bdf8;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ===== Grid dot background for what-we-do ===== */
.dot-bg {
    background-image: radial-gradient(rgba(0,0,0,0.06) 1px, transparent 1px);
    background-size: 28px 28px;
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06); }
    .stat-item:nth-child(odd) { border-right: 1px solid rgba(255,255,255,0.06); }
    .stat-item:nth-last-child(-n+2) { border-bottom: none; }
    .hero-title { font-size: clamp(2.4rem, 10vw, 3.5rem); }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
