/* GOLDEN INK — Animation Layer (Faz 5) */

/* ===== PRELOADER ===== */
#preloader { position: fixed; inset: 0; background: var(--black); z-index: 9999; display: flex; align-items: center; justify-content: center; flex-direction: column; transition: opacity 400ms var(--ease); }
#preloader.done { opacity: 0; pointer-events: none; }
.preloader-logo { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }
.preloader-logo svg { width: 160px; height: 100px; }
.stroke-path { stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 1000ms cubic-bezier(0.65,0,0.35,1) forwards; }
.stroke-path:nth-child(2) { animation-delay: 200ms; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.preloader-text { font-family: var(--font-accent, var(--font-mono)); font-size: 14px; letter-spacing: 0.5em; color: var(--gold); opacity: 0; animation: fadeInUp 400ms 800ms var(--ease) forwards; }

/* ===== SCROLL ANIMATIONS ===== */
.fade-up { opacity: 0; transform: translateY(32px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
.fade-in { opacity: 0; transition: opacity 600ms var(--ease); }
.scale-in { opacity: 0; transform: scale(0.92); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
.slide-left { opacity: 0; transform: translateX(-40px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
.slide-right { opacity: 0; transform: translateX(40px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
.fade-up.is-visible, .fade-in.is-visible, .scale-in.is-visible, .slide-left.is-visible, .slide-right.is-visible { opacity: 1; transform: none; }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ===== CUSTOM CURSOR ===== */
#cursor-ring, #cursor-dot { position: fixed; pointer-events: none; z-index: 99999; border-radius: 50%; transform: translate(-50%, -50%); }
#cursor-ring { width: 36px; height: 36px; border: 1.5px solid var(--gold); transition: width 80ms var(--ease), height 80ms var(--ease), background 80ms var(--ease), border-color 80ms var(--ease); mix-blend-mode: difference; }
#cursor-dot { width: 6px; height: 6px; background: var(--gold); }
.cursor-hover #cursor-ring { width: 60px; height: 60px; border-color: var(--gold-light, #E8C97A); background: rgba(201,168,76,0.08); }
.cursor-click #cursor-ring { width: 24px; height: 24px; background: rgba(201,168,76,0.2); }
@media (hover: none) { #cursor-ring, #cursor-dot { display: none !important; } }

/* ===== FILM GRAIN OVERLAY ===== */
body::after { content: ''; position: fixed; inset: 0; z-index: 9998; pointer-events: none; opacity: 0.032; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); animation: grain 0.4s steps(1) infinite; }
@keyframes grain { 0% { transform: translate(0,0); } 25% { transform: translate(-3%,4%); } 50% { transform: translate(3%,-2%); } 75% { transform: translate(-2%,3%); } }

/* ===== PARTICLE CANVAS ===== */
#particle-canvas { position: absolute; inset: 0; pointer-events: none; z-index: 2; }

/* ===== PAGE PROGRESS BAR ===== */
#page-progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: linear-gradient(90deg, #9e7e2e, var(--gold), #E8C97A); z-index: 99998; box-shadow: 0 0 12px rgba(201,168,76,0.6); transition: width 200ms var(--ease), opacity 300ms; pointer-events: none; }

/* ===== EXIT INTENT POPUP ===== */
#exit-popup { position: fixed; inset: 0; z-index: 9990; display: none; align-items: center; justify-content: center; }
#exit-popup.active { display: flex; }
.exit-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(8px); }
.exit-content { position: relative; z-index: 1; max-width: 480px; width: 90%; }
.exit-close { position: absolute; top: -12px; right: -12px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); color: var(--white); font-size: var(--text-base); cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 2; transition: border-color var(--fast) var(--ease); }
.exit-close:hover { border-color: var(--gold); color: var(--gold); }
.exit-frame { background: var(--surface); border: 1px solid var(--gold); border-radius: var(--radius-md); padding: 3rem 2rem; text-align: center; }
.exit-badge { display: inline-block; font-size: 10px; letter-spacing: 0.2em; color: var(--black); background: var(--gold); padding: 4px 16px; border-radius: 100px; margin-bottom: 1.5rem; }
.exit-frame h2 { font-family: var(--font-heading); font-size: var(--text-xl); margin-bottom: 0.75rem; }
.exit-frame p { font-size: var(--text-sm); color: var(--muted); margin-bottom: 0.5rem; }
.exit-sub { font-size: var(--text-xs) !important; margin-bottom: 1.5rem !important; }
.exit-frame .btn-primary { width: 100%; justify-content: center; margin-bottom: 1rem; }
.exit-dismiss { background: none; border: none; color: var(--muted); font-size: var(--text-xs); cursor: pointer; padding: 8px; }
.exit-dismiss:hover { color: var(--white); }

/* ===== LANG SWITCHER ===== */
.lang-switcher { position: relative; }
.lang-switcher__trigger { display: flex; align-items: center; gap: 6px; background: none; border: 1px solid var(--border); padding: 6px 12px; border-radius: var(--radius-sm); color: var(--white); font-size: var(--text-xs); cursor: pointer; transition: border-color var(--fast) var(--ease); }
.lang-switcher__trigger:hover { border-color: var(--gold); }
.lang-switcher__flag { font-size: 14px; }
.lang-switcher__dropdown { position: absolute; top: calc(100% + 8px); right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 160px; display: none; flex-direction: column; overflow: hidden; z-index: 200; }
.lang-switcher.open .lang-switcher__dropdown { display: flex; }
.lang-switcher__dropdown a { padding: 10px 16px; font-size: var(--text-xs); color: var(--muted); text-decoration: none; transition: all var(--fast) var(--ease); display: flex; align-items: center; gap: 8px; }
.lang-switcher__dropdown a:hover, .lang-switcher__dropdown a.active { background: rgba(201,168,76,0.1); color: var(--gold); }

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .fade-up, .fade-in, .scale-in, .slide-left, .slide-right { opacity: 1; transform: none; transition: none; }
  body::after { animation: none; }
  #particle-canvas { display: none; }
  .stroke-path { animation: none; stroke-dashoffset: 0; }
  .preloader-text { animation: none; opacity: 1; }
}
