/* ─────────────────────────────────────────────────────────────
   The APE AI — marcel.theape.pt
   css/style.css — Shared stylesheet (PT + EN)
   ───────────────────────────────────────────────────────────── */

/* ── Google Font — font-display:swap evita FOIT (invisible text) ── */
/* Loaded via <link> in HTML for best LCP. This @font-face enforces swap. */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('https://fonts.gstatic.com/s/inter/v13/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiJ-Ek-_EeA.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* ── Base ───────────────────────────────────────────────────── */
body {
    background-color: #0E1017;
    color: #F5F5F5;
    margin: 0;
    overflow-x: hidden;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: #0E1017; }
::-webkit-scrollbar-thumb { background: #FF4E01; border-radius: 10px; }

/* ── Video BG — suppress caption / alt text before load ─────── */
video {
    background: #FF4E01; /* warm placeholder instead of black flash */
    color: transparent;
    font-size: 0;
}
video::-webkit-media-text-track-container { display: none !important; }
video::cue { visibility: hidden; display: none; }

/* ── Keyframe Animations ────────────────────────────────────── */
@keyframes scan {
    0%   { top: -2px; opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

@keyframes pulse-ring {
    0%   { transform: scale(0.8); opacity: 0.8; }
    100% { transform: scale(2.5); opacity: 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-12px); }
}

@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position:  200% center; }
}

@keyframes typing {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

@keyframes grain {
    0%, 100% { transform: translate(0, 0); }
    10%  { transform: translate(-2%, -3%); }
    30%  { transform: translate( 3%, -1%); }
    50%  { transform: translate(-1%,  2%); }
    70%  { transform: translate( 1%,  3%); }
    90%  { transform: translate(-3%,  1%); }
}

@keyframes gradient-x {
    0%, 100% { background-position: 0% 50%; }
    50%       { background-position: 100% 50%; }
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

@keyframes grow-bar {
    from { width: 0%; }
    to   { width: var(--target-width); }
}

/* ── Animation Utility Classes ──────────────────────────────── */
.animate-scan        { animation: scan 3s linear infinite; }
.animate-pulse-ring  { animation: pulse-ring 2s ease-out infinite; }
.animate-float       { animation: float 4s ease-in-out infinite; }
.animate-shimmer     { animation: shimmer 3s linear infinite; }
.animate-grain       { animation: grain 0.5s steps(1) infinite; }
.animate-gradient-x  { animation: gradient-x 4s ease infinite; background-size: 200% 200%; }
.animate-spin-slow   { animation: spin-slow 8s linear infinite; }
.animate-blink       { animation: blink 1s ease-in-out infinite; }

/* ── Gradient Text ──────────────────────────────────────────── */
.gradient-text {
    background: linear-gradient(135deg, #FF4E01, #FF8C42, #FF4E01);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

/* ── Glow Effects ───────────────────────────────────────────── */
.glow-orange        { box-shadow: 0 0 60px rgba(255,78,1,0.3), 0 20px 60px rgba(0,0,0,0.5); }
.glow-orange-strong { box-shadow: 0 0 100px rgba(255,78,1,0.5), 0 0 200px rgba(255,78,1,0.2); }
.glow-text          { text-shadow: 0 0 40px rgba(255,78,1,0.6); }

/* ── Grid Background ────────────────────────────────────────── */
.grid-bg {
    background-image:
        linear-gradient(rgba(255,78,1,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,78,1,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* ── Noise Overlay ──────────────────────────────────────────── */
.noise::after {
    content: '';
    position: fixed;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    animation: grain 0.5s steps(1) infinite;
    z-index: 9999;
}

/* ── Chat Bubbles ───────────────────────────────────────────── */
.chat-bubble { max-width: 85%; }

.typing-dot {
    width: 6px; height: 6px;
    background: #FF4E01;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
}
.typing-dot:nth-child(1) { animation: blink 1s 0.0s infinite; }
.typing-dot:nth-child(2) { animation: blink 1s 0.2s infinite; }
.typing-dot:nth-child(3) { animation: blink 1s 0.4s infinite; }

/* ── Chat Scrollbar ─────────────────────────────────────────── */
.custom-scrollbar::-webkit-scrollbar       { width: 3px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(255,78,1,0.3); border-radius: 10px; }

/* ── 3D Tilt Card ───────────────────────────────────────────── */
.tilt-card    { transform-style: preserve-3d; }
.tilt-content { transform: translateZ(30px); }

/* ── Scanner Line ───────────────────────────────────────────── */
.scanner-line {
    position: absolute;
    left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #FF4E01, transparent);
    box-shadow: 0 0 20px #FF4E01;
    animation: scan 2.5s linear infinite;
}

/* ── Metric Bar ─────────────────────────────────────────────── */
.metric-bar { animation: grow-bar 1.5s ease-out forwards; }

/* ── Section Fade (IntersectionObserver fallback) ───────────── */
.section-fade {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.section-fade.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Font inter utility ─────────────────────────────────────── */
.font-inter { font-family: 'Inter', sans-serif; }
