/* =============================================
   VIRAS VISA — Cinematic 3D Stylesheet
   ============================================= */

:root{
  --bg-1:#05070c;
  --bg-2:#0d1320;
  --bg-3:#141d2e;
  --gold:#c9a55c;
  --gold-soft:#e8d4a0;
  --gold-glow:rgba(201,165,92,0.35);
  --ivory:#f3efe6;
  --muted:#8d95a6;
  --glass:rgba(255,255,255,0.045);
  --glass-hi:rgba(255,255,255,0.09);
  --glass-border:rgba(201,165,92,0.25);
  --ease-cinema:cubic-bezier(.19,1,.22,1);
  --ease-spring:cubic-bezier(.34,1.56,.64,1);
}

*{margin:0;padding:0;box-sizing:border-box;}
html,body{height:100%;overflow:hidden;overflow:clip;max-width:100%;}

body{
  background:linear-gradient(180deg,var(--bg-1) 0%,var(--bg-2) 55%,var(--bg-3) 100%);
  color:var(--ivory);
  font-family:'Vazirmatn','Jost',sans-serif;
  overflow:hidden;
  position:relative;
  -webkit-font-smoothing:antialiased;
  perspective:1400px;
  perspective-origin:50% 40%;
}

body.lang-latin{font-family:'Jost','Vazirmatn',sans-serif;}

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    animation-duration:0.01ms !important;
    animation-iteration-count:1 !important;
    transition-duration:0.01ms !important;
  }
}

/* =========================================
   CINEMATIC BACKGROUND
   ========================================= */

.bg-layer{position:fixed;inset:0;pointer-events:none;overflow:hidden;}

.aurora{
  z-index:0;
  background:
    radial-gradient(ellipse 70% 50% at 20% 0%,  rgba(201,165,92,0.16), transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 20%, rgba(80,130,200,0.14), transparent 60%),
    radial-gradient(ellipse 80% 60% at 50% 110%,rgba(140,80,200,0.10), transparent 65%);
  animation:auroraShift 22s ease-in-out infinite alternate;
  filter:blur(10px);
}

@keyframes auroraShift{
  0%   {transform:translate3d(0,0,0)   scale(1);}
  50%  {transform:translate3d(-2%,1%,0) scale(1.06);}
  100% {transform:translate3d(2%,-1%,0)  scale(1.02);}
}

.stars{z-index:1;}
.star{
  position:absolute;border-radius:50%;
  background:#fff;opacity:0.7;
  box-shadow:0 0 6px rgba(255,255,255,0.8);
  animation:starPulse 4s ease-in-out infinite;
}
@keyframes starPulse{
  0%,100%{opacity:0.15;transform:scale(1);}
  50%    {opacity:0.9; transform:scale(1.4);}
}

/* floating orbs */
.orbs{z-index:2;}
.orb{
  position:absolute;border-radius:50%;
  background:radial-gradient(circle at 30% 30%, rgba(232,212,160,0.9), rgba(201,165,92,0.05) 70%);
  filter:blur(1px);
  animation:orbFloat linear infinite;
  opacity:0.7;
}
@keyframes orbFloat{
  0%   {transform:translate3d(0,0,0) scale(1);}
  50%  {transform:translate3d(30px,-40px,0) scale(1.15);}
  100% {transform:translate3d(0,0,0) scale(1);}
}

/* perspective grid floor */
.grid{
  z-index:1;
  bottom:0;top:auto;height:55vh;
  background-image:
    linear-gradient(rgba(201,165,92,0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,165,92,0.10) 1px, transparent 1px);
  background-size:60px 60px;
  transform:perspective(500px) rotateX(60deg);
  transform-origin:bottom center;
  mask-image:linear-gradient(to top, #000 0%, transparent 90%);
  -webkit-mask-image:linear-gradient(to top, #000 0%, transparent 90%);
  animation:gridScroll 18s linear infinite;
  opacity:0.55;
}
@keyframes gridScroll{
  to{background-position:0 60px, 60px 0;}
}

/* vignette */
.vignette{
  position:fixed;inset:0;z-index:3;pointer-events:none;
  background:radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.65) 100%);
}

/* film grain */
.grain{
  position:fixed;inset:0;z-index:4;pointer-events:none;
  opacity:0.045;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  animation:grainShift 0.5s steps(3) infinite;
}
@keyframes grainShift{
  0%  {background-position:0 0;}
  33% {background-position:-30px 20px;}
  66% {background-position:20px -30px;}
  100%{background-position:0 0;}
}

/* =========================================
   3D ORBIT RINGS
   ========================================= */
.orbit{
  position:fixed;top:50%;left:50%;
  border-radius:50%;
  border:1px solid rgba(201,165,92,0.15);
  pointer-events:none;z-index:2;
  transform-style:preserve-3d;
}
.orbit-1{
  width:min(70vw,640px);height:min(70vw,640px);
  transform:translate(-50%,-50%) rotateX(72deg);
  animation:orbitSpin 32s linear infinite;
  border-color:rgba(201,165,92,0.22);
}
.orbit-2{
  width:min(92vw,860px);height:min(92vw,860px);
  transform:translate(-50%,-50%) rotateX(68deg) rotateY(14deg);
  animation:orbitSpin 55s linear infinite reverse;
  border-color:rgba(120,160,220,0.16);
}
.orbit-3{
  width:min(100vw,1100px);height:min(100vw,1100px);
  transform:translate(-50%,-50%) rotateX(64deg) rotateY(-14deg);
  animation:orbitSpin 90s linear infinite;
  border-color:rgba(201,165,92,0.10);
  border-style:dashed;
}
@keyframes orbitSpin{
  to{transform:translate(-50%,-50%) rotateX(72deg) rotateZ(360deg);}
}

/* =========================================
   SCREENS + CINEMATIC TRANSITIONS
   ========================================= */
.screen{
  position:fixed;inset:0;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  z-index:5;
  padding:6vh 5vw;
  opacity:0;visibility:hidden;
  transform-style:preserve-3d;
  transform:translateZ(-200px) rotateX(10deg) scale(0.92);
  transition:
    opacity .9s var(--ease-cinema),
    transform 1.1s var(--ease-cinema),
    visibility 0s linear .9s;
  pointer-events:none;
}
.screen.active{
  opacity:1;visibility:visible;
  transform:translateZ(0) rotateX(0) scale(1);
  transition:
    opacity .9s var(--ease-cinema),
    transform 1.1s var(--ease-cinema),
    visibility 0s;
  pointer-events:auto;
}

.intro-screen{
  background:radial-gradient(circle at center, rgba(11,20,24,0.7), rgba(5,7,12,0.96));
}

.stage{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  transform-style:preserve-3d;
  width:100%;
}

.stage-intro{
  gap:2rem;
  perspective:1000px;
}

.intro-logo-wrap{
  position:relative;
  display:flex;align-items:center;justify-content:center;
  width:min(68vw, 560px);
  height:min(44vw, 260px);
  transform-style:preserve-3d;
  animation:introReveal 1.7s cubic-bezier(.18,.9,.18,1) both;
}

@keyframes introReveal{
  0% {
    opacity:0;
    transform:scale(0.46) translateY(80px) rotateX(34deg) rotateY(-26deg);
    filter:blur(10px);
  }
  30% {
    opacity:0.9;
    transform:scale(0.8) translateY(20px) rotateX(16deg) rotateY(-10deg);
    filter:blur(4px);
  }
  58% {
    opacity:1;
    transform:scale(1) translateY(0) rotateX(0deg) rotateY(0deg);
    filter:blur(0);
  }
  100% {
    opacity:1;
    transform:scale(1) translateY(0) rotateX(0deg) rotateY(0deg);
    filter:blur(0);
  }
}

.intro-orbit{
  position:absolute;
  border:1px solid rgba(201,165,92,0.35);
  border-radius:50%;
  pointer-events:none;
}

.intro-orbit-1{
  width:100%;
  height:100%;
  transform:rotateX(68deg) rotateY(18deg);
  animation:orbitPulse1 3.5s ease-in-out infinite alternate;
}

.intro-orbit-2{
  width:72%;
  height:72%;
  transform:rotateY(72deg) rotateX(58deg);
  border-color:rgba(255,255,255,0.18);
  animation:orbitPulse2 3.8s ease-in-out infinite alternate;
}

@keyframes orbitPulse1 {
  0% { transform:rotateX(68deg) rotateY(18deg) scale(0.96); opacity:0.45; }
  100% { transform:rotateX(74deg) rotateY(36deg) scale(1.06); opacity:0.9; }
}

@keyframes orbitPulse2 {
  0% { transform:rotateY(72deg) rotateX(58deg) scale(0.9); opacity:0.4; }
  100% { transform:rotateY(110deg) rotateX(70deg) scale(1.08); opacity:0.9; }
}

.intro-core{
  position:relative;
  z-index:2;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:0.75rem;
  padding:2rem 2.4rem;
  border-radius:24px;
  background:linear-gradient(135deg, rgba(201,165,92,0.08), rgba(255,255,255,0.02));
  border:1px solid rgba(201,165,92,0.62);
  box-shadow:0 0 30px rgba(201,165,92,0.18), inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter:blur(10px);
  overflow:visible;
}

.frame-trace{
  position:absolute;
  inset:-1px;
  width:calc(100% + 2px);
  height:calc(100% + 2px);
  z-index:3;
  pointer-events:none;
  overflow:visible;
}

.frame-base,
.frame-comet{
  fill:none;
  vector-effect:non-scaling-stroke;
  stroke-linejoin:round;
}

.frame-base{
  stroke:rgba(201,165,92,0.72);
  stroke-width:1.5;
}

.frame-comet{
  stroke:#fff8e8;
  stroke-width:3;
  stroke-linecap:round;
  stroke-dasharray:16 84;
  filter:drop-shadow(0 0 5px rgba(255,244,214,0.95)) drop-shadow(0 0 12px rgba(201,165,92,0.9));
  animation:frameTravel 2.6s linear infinite;
}

@keyframes frameTravel{
  to{stroke-dashoffset:-100;}
}

.intro-word{
  position:relative;
  z-index:1;
  display:inline-flex;
  direction:ltr;
  unicode-bidi:isolate;
  align-items:center;
  justify-content:center;
  flex-wrap:nowrap;
  white-space:nowrap;
  font-family:'Cormorant Garamond',serif;
  font-weight:700;
  font-size:clamp(2rem,4.8vw,3.6rem);
  letter-spacing:0.18em;
  line-height:1;
  color:#fff4d8;
  -webkit-text-fill-color:#fff4d8;
  text-shadow:0 0 16px rgba(201,165,92,0.85), 0 0 36px rgba(201,165,92,0.38);
  animation:wordGlow 2.4s ease-in-out infinite alternate;
}

.intro-word,
.intro-tag{
  z-index:4;
}

.intro-word .char{
  display:inline-block;
  color:inherit;
  -webkit-text-fill-color:currentColor;
  opacity:1;
  transform:none;
  animation:charReveal 0.55s cubic-bezier(.2,.8,.2,1) both;
  animation-delay:calc(var(--i, 0) * 0.07s + 0.12s);
}

.intro-word .char.space{
  width:0.45em;
  display:inline-block;
}

@keyframes charReveal {
  0% {
    opacity:0;
    transform:translateY(22px) scale(0.9);
    filter:blur(6px);
  }
  100% {
    opacity:1;
    transform:translateY(0) scale(1);
    filter:blur(0);
  }
}

@keyframes wordGlow {
  from { text-shadow:0 0 10px rgba(201,165,92,0.45); }
  to { text-shadow:0 0 22px rgba(255,244,214,0.95), 0 0 46px rgba(201,165,92,0.55); }
}

.intro-tag{
  position:relative;
  z-index:1;
  font-size:0.7rem;
  letter-spacing:0.3em;
  color:rgba(255,255,255,0.66);
  text-transform:uppercase;
}

.intro-loader{
  position:relative;
  width:min(42vw, 300px);
  height:5px;
  border-radius:999px;
  background:rgba(255,255,255,0.08);
  overflow:hidden;
  box-shadow:0 0 20px rgba(201,165,92,0.12);
}

.loader-bar{
  position:absolute;
  inset:0 auto 0 0;
  width:38%;
  border-radius:inherit;
  background:linear-gradient(90deg, rgba(201,165,92,0.4), rgba(255,255,255,0.95), rgba(201,165,92,0.5));
  box-shadow:0 0 18px rgba(201,165,92,0.38);
  animation:loadingFlow 2.1s ease-in-out infinite;
}

@keyframes loadingFlow {
  0% { transform:translateX(-20%); opacity:0.45; }
  50% { transform:translateX(130%); opacity:1; }
  100% { transform:translateX(210%); opacity:0.5; }
}

.stage-lang{
  position:relative;
  perspective:1200px;
}

.stage-lang::before{
  content:'';
  position:absolute;
  width:min(72vw, 540px);
  height:min(72vw, 540px);
  border-radius:50%;
  background:radial-gradient(circle, rgba(201,165,92,0.18), transparent 62%);
  filter:blur(22px);
  opacity:0.8;
  animation:haloPulse 8s ease-in-out infinite alternate;
}

@keyframes haloPulse {
  0% { transform: scale(0.92) translateY(18px); opacity:0.4; }
  100% { transform: scale(1.08) translateY(-8px); opacity:0.9; }
}

/* =========================================
   BRAND
   ========================================= */
.brand{
  text-align:center;margin-bottom:0.4rem;
  transform-style:preserve-3d;
  animation:brandFloat 7s ease-in-out infinite;
  transition:transform 0.5s var(--ease-cinema);
}
@keyframes brandFloat {
  0%, 100% { transform: translateY(0) translateZ(20px); }
  50% { transform: translateY(-10px) translateZ(30px); }
}
.brand-line{
  display:block;
  font-family:'Cormorant Garamond',serif;
  font-weight:500;
  letter-spacing:0.32em;
  font-size:clamp(1.5rem,3.4vw,2.4rem);
  color:var(--gold-soft);
  text-shadow:
    0 0 20px rgba(201,165,92,0.5),
    0 0 60px rgba(201,165,92,0.25);
  background:linear-gradient(120deg,
    var(--gold-soft) 0%,
    #fff8e0 30%,
    var(--gold) 50%,
    #fff8e0 70%,
    var(--gold-soft) 100%);
  background-size:200% 100%;
  -webkit-background-clip:text;
  background-clip:text;
  -webkit-text-fill-color:transparent;
  animation:shimmer 6s linear infinite;
}
@keyframes shimmer{
  to{background-position:-200% 0;}
}
.brand-sub{
  display:block;
  font-family:'Vazirmatn',sans-serif;
  font-size:0.72rem;
  letter-spacing:0.5em;
  color:var(--muted);
  margin-top:0.6rem;
  font-weight:300;
}

/* letter reveal */
.brand-line,
.brand-sub{
  opacity:0;
  transform:translateY(-14px);
  animation:reveal .9s var(--ease-cinema) forwards;
}
.brand-line{animation-delay:.15s;}
.brand-sub {animation-delay:.35s;}

@keyframes reveal{to{opacity:1;transform:none;}}

/* =========================================
   GLASS CARDS (with 3D + glow)
   ========================================= */
.lang-card,
.overlay-panel{
  position:relative;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.015));
  border:1px solid var(--glass-border);
  border-radius:26px;
  backdrop-filter:blur(22px) saturate(140%);
  -webkit-backdrop-filter:blur(22px) saturate(140%);
  padding:2.8rem clamp(1.4rem,5vw,3.4rem);
  box-shadow:
    0 30px 80px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -1px 0 rgba(0,0,0,0.4);
  max-width:680px;width:100%;
  transform-style:preserve-3d;
  transition:transform .4s var(--ease-cinema), box-shadow .4s var(--ease-cinema);
  opacity:0;transform:translateY(30px) rotateX(-8deg) rotateY(-8deg);
  animation:cardReveal 1.1s .45s var(--ease-cinema) forwards;
}
.lang-card::before,
.overlay-panel::before{
  content:'';
  position:absolute;
  inset:1px;
  border-radius:inherit;
  border:1px solid rgba(255,255,255,0.06);
  pointer-events:none;
}
@keyframes cardReveal{
  to{opacity:1;transform:translateY(0) rotateX(0) rotateY(0);}
}

.card-glow{
  position:absolute;inset:-1px;border-radius:inherit;
  background:radial-gradient(400px circle at var(--mx,50%) var(--my,50%),
              rgba(201,165,92,0.18), transparent 45%);
  opacity:0;transition:opacity .4s ease;pointer-events:none;
}
.lang-card:hover .card-glow,
.country-card:hover .card-glow,
.overlay-panel:hover .card-glow{opacity:1;}

.lang-prompt{
  text-align:center;font-size:0.95rem;color:var(--muted);
  letter-spacing:0.06em;margin-bottom:2rem;font-weight:300;
  text-shadow:0 0 20px rgba(201,165,92,0.18);
}

/* =========================================
   LANGUAGE GRID
   ========================================= */
.lang-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(120px,1fr));
  gap:0.85rem;
  transform-style:preserve-3d;
  perspective:1200px;
}

.lang-btn{
  position:relative;
  background:linear-gradient(160deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
  border:1px solid rgba(255,255,255,0.10);
  color:var(--ivory);
  padding:1.15rem 0.8rem 0.9rem;
  border-radius:18px;
  font-family:inherit;
  cursor:pointer;
  transition:
    transform .35s var(--ease-spring),
    border-color .3s ease,
    background .3s ease,
    box-shadow .35s ease,
    filter .3s ease;
  display:flex;flex-direction:column;align-items:center;gap:0.35rem;
  transform-style:preserve-3d;
  overflow:hidden;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.05);
}
.lang-btn::before{
  content:'';position:absolute;inset:0;
  background:linear-gradient(120deg, transparent 30%, rgba(201,165,92,0.28) 50%, transparent 70%);
  transform:translateX(-120%);
  transition:transform .7s var(--ease-cinema);
}
.lang-btn::after{
  content:'';
  position:absolute;
  inset:8px;
  border-radius:12px;
  border:1px solid rgba(201,165,92,0.10);
  opacity:0;
  transition:opacity .3s ease;
}
.lang-btn:hover::before,
.lang-btn:focus-visible::before{transform:translateX(120%);}
.lang-btn:hover::after,
.lang-btn:focus-visible::after,
.lang-btn.selected::after{opacity:1;}
.lang-btn:hover,
.lang-btn:focus-visible,
.lang-btn.selected{
  border-color:var(--gold);
  background:linear-gradient(160deg, rgba(201,165,92,0.16), rgba(201,165,92,0.03));
  transform:translateY(-6px) rotateX(9deg) rotateY(-10deg) translateZ(26px);
  box-shadow:
    0 22px 44px rgba(0,0,0,0.48),
    0 0 28px rgba(201,165,92,0.25),
    inset 0 1px 0 rgba(255,255,255,0.12);
  outline:none;
  filter:saturate(1.2);
}
.lang-btn:active{transform:translateY(-2px) rotateX(4deg) rotateY(-6deg) translateZ(10px) scale(0.98);}

.btn-code{
  font-family:'Cormorant Garamond',serif;
  font-size:1.15rem;letter-spacing:0.26em;
  color:var(--gold-soft);font-weight:500;
  transform:translateZ(18px);
}
.btn-name{
  font-size:0.86rem;color:var(--ivory);font-weight:300;
  transform:translateZ(12px);
}

/* =========================================
   TOP BAR
   ========================================= */
.top-bar{
  position:absolute;top:0;left:0;right:0;
  display:flex;justify-content:space-between;align-items:center;
  padding:2rem clamp(1.2rem,5vw,3.5rem);
  z-index:6;
  opacity:0;animation:reveal .8s .3s var(--ease-cinema) forwards;
}
.top-brand{
  font-family:'Cormorant Garamond',serif;
  letter-spacing:0.18em;font-size:1.05rem;
  color:var(--gold-soft);
  text-shadow:0 0 16px rgba(201,165,92,0.4);
}
body:not(.lang-latin) .top-brand{font-family:'Vazirmatn',serif;letter-spacing:0.1em;}

.back-btn{
  position:relative;
  background:rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.14);
  color:var(--muted);
  padding:0.6rem 1.3rem;
  border-radius:999px;
  font-family:inherit;font-size:0.85rem;cursor:pointer;
  transition:
    border-color .3s, color .3s,
    transform .35s var(--ease-spring),
    box-shadow .35s ease;
  backdrop-filter:blur(8px);
}
.back-btn:hover,
.back-btn:focus-visible{
  border-color:var(--gold);
  color:var(--gold-soft);
  transform:translateY(-2px);
  box-shadow:0 8px 24px rgba(201,165,92,0.25);
  outline:none;
}

/* =========================================
   COUNTRY SCREEN
   ========================================= */
.country-heading{
  text-align:center;margin-bottom:3.2rem;
  transform-style:preserve-3d;
  transition:transform .5s var(--ease-cinema);
}
.country-heading h1{
  font-family:'Cormorant Garamond',serif;
  font-size:clamp(1.9rem,4.4vw,3.2rem);
  font-weight:500;color:var(--ivory);
  text-shadow:0 0 40px rgba(201,165,92,0.25);
  opacity:0;transform:translateY(20px);
  animation:reveal .9s .2s var(--ease-cinema) forwards;
}
body:not(.lang-latin) .country-heading h1{
  font-family:'Vazirmatn',sans-serif;font-weight:500;
}
.country-heading p{
  margin-top:0.7rem;color:var(--muted);
  font-size:0.95rem;font-weight:300;
  opacity:0;transform:translateY(20px);
  animation:reveal .9s .35s var(--ease-cinema) forwards;
}

.country-grid{
  display:flex;gap:1.8rem;flex-wrap:wrap;justify-content:center;
  max-width:920px;width:100%;
  transform-style:preserve-3d;
}

/* =========================================
   COUNTRY CARDS (real 3D tilt)
   ========================================= */
.country-card{
  position:relative;
  flex:1 1 320px;max-width:400px;min-height:300px;
  background:
    linear-gradient(160deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.015) 60%, rgba(201,165,92,0.03) 100%);
  border:1px solid var(--glass-border);
  border-radius:26px;
  backdrop-filter:blur(20px) saturate(150%);
  -webkit-backdrop-filter:blur(20px) saturate(150%);
  cursor:pointer;
  transform-style:preserve-3d;
  transition:
    transform .25s var(--ease-cinema),
    box-shadow .35s var(--ease-cinema),
    border-color .35s ease;
  box-shadow:
    0 25px 60px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.08);
  overflow:hidden;
  opacity:0;
  animation:cardReveal .9s var(--ease-cinema) forwards;
}
.country-card[data-country="canada"]{animation-delay:.5s;}
.country-card[data-country="usa"]   {animation-delay:.65s;}

.country-card::after{
  content:'';position:absolute;inset:0;border-radius:inherit;
  background:radial-gradient(500px circle at var(--mx,50%) var(--my,50%),
              rgba(201,165,92,0.22), transparent 45%);
  opacity:0;transition:opacity .5s ease;pointer-events:none;
}
.country-card:hover::after{opacity:1;}

.country-card:hover,
.country-card:focus-visible{
  border-color:rgba(201,165,92,0.7);
  box-shadow:
    0 40px 90px rgba(0,0,0,0.7),
    0 0 60px rgba(201,165,92,0.22),
    inset 0 1px 0 rgba(255,255,255,0.12);
  outline:none;
}

.card-inner{
  position:relative;z-index:2;
  padding:2.6rem 2rem 2.2rem;
  display:flex;flex-direction:column;align-items:center;text-align:center;
  gap:1rem;height:100%;
  transform:translateZ(40px);
  transform-style:preserve-3d;
}

.card-icon{
  width:70px;height:70px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  background:radial-gradient(circle at 30% 30%, rgba(232,212,160,0.18), rgba(201,165,92,0.02) 70%);
  border:1px solid rgba(201,165,92,0.28);
  box-shadow:0 0 30px rgba(201,165,92,0.15);
  transform:translateZ(30px);
  transition:transform .45s var(--ease-spring), box-shadow .45s ease;
}
.country-card:hover .card-icon{
  transform:translateZ(60px) scale(1.08);
  box-shadow:0 0 50px rgba(201,165,92,0.4);
}
.card-icon svg{
  width:34px;height:34px;stroke:var(--gold-soft);
  filter:drop-shadow(0 0 6px rgba(201,165,92,0.5));
}

.country-card h2{
  font-family:'Cormorant Garamond',serif;
  font-size:1.8rem;font-weight:500;
  color:var(--ivory);
  transform:translateZ(35px);
  transition:transform .45s var(--ease-spring);
}
body:not(.lang-latin) .country-card h2{font-family:'Vazirmatn',sans-serif;}
.country-card:hover h2{transform:translateZ(55px);}

.country-card p{
  color:var(--muted);font-size:0.9rem;font-weight:300;line-height:1.7;
  transform:translateZ(25px);
  transition:transform .45s var(--ease-spring);
}
.country-card:hover p{transform:translateZ(45px);}

.card-cta{
  margin-top:auto;padding-top:1rem;
  display:flex;align-items:center;gap:0.5rem;
  font-size:0.75rem;letter-spacing:0.2em;text-transform:uppercase;
  color:var(--gold-soft);opacity:0;
  transform:translateY(10px) translateZ(30px);
  transition:opacity .4s ease, transform .5s var(--ease-cinema);
}
.country-card:hover .card-cta{opacity:1;transform:translateY(0) translateZ(50px);}
.cta-dot{
  width:6px;height:6px;border-radius:50%;
  background:var(--gold);
  box-shadow:0 0 10px var(--gold);
  animation:pulseDot 1.8s ease-in-out infinite;
}
@keyframes pulseDot{
  0%,100%{transform:scale(1);opacity:1;}
  50%{transform:scale(1.6);opacity:0.5;}
}

/* =========================================
   OVERLAY
   ========================================= */
.overlay{
  position:fixed;inset:0;z-index:20;
  display:flex;align-items:center;justify-content:center;
  background:rgba(3,5,10,0.85);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  opacity:0;visibility:hidden;
  transition:opacity .55s var(--ease-cinema), visibility 0s linear .55s;
  padding:2rem;
  perspective:1200px;
}
.overlay.active{
  opacity:1;visibility:visible;
  transition:opacity .55s var(--ease-cinema), visibility 0s;
}
.overlay-panel{
  max-width:520px;text-align:center;
  display:flex;flex-direction:column;align-items:center;gap:1.2rem;
  transform:translateY(40px) rotateX(-12deg) scale(0.94);
  opacity:0;
  transition:transform .6s var(--ease-cinema), opacity .5s ease;
  animation:none;
}
.overlay.active .overlay-panel{
  transform:translateY(0) rotateX(0) scale(1);
  opacity:1;
}
.overlay-icon{
  font-size:2rem;color:var(--gold);
  text-shadow:0 0 24px var(--gold-glow);
  animation:spinSlow 8s linear infinite;
}
@keyframes spinSlow{to{transform:rotate(360deg);}}
.overlay h2{
  font-family:'Cormorant Garamond',serif;
  font-size:1.9rem;color:var(--gold-soft);
  text-shadow:0 0 30px var(--gold-glow);
}
body:not(.lang-latin) .overlay h2{font-family:'Vazirmatn',sans-serif;}
.overlay p{color:var(--muted);font-weight:300;line-height:1.7;}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width:720px){
  .country-grid{flex-direction:column;align-items:center;gap:1.4rem;}
  .country-card{max-width:100%;}
  .orbit-1,.orbit-2{opacity:0.6;}
}

@media (max-width:520px){
  .lang-grid{grid-template-columns:repeat(2,1fr);}
  .lang-card{padding:2.2rem 1.4rem;}
  .card-inner{padding:2rem 1.4rem 1.6rem;}
}
/* =========================================
   PHOTO UPGRADE — flags + cinematic country cards
   ========================================= */
.btn-flag{display:block;width:40px;height:28px;border-radius:5px;overflow:hidden;
  box-shadow:0 6px 16px rgba(0,0,0,.5),0 0 0 1px rgba(255,255,255,.18);transform:translateZ(22px);
  background:linear-gradient(135deg,#1c2740,#0d1320);transition:transform .45s var(--ease-spring)}
.btn-flag img{width:100%;height:100%;object-fit:cover;display:block;opacity:0;transition:opacity .6s}
.btn-flag img.loaded{opacity:1}
.lang-btn:hover .btn-flag,.lang-btn.selected .btn-flag{transform:translateZ(40px) scale(1.1)}

.country-card{min-height:460px;max-width:440px;border-radius:28px}
.country-card[data-country="canada"]{--tint:rgba(150,40,55,.35)}
.country-card[data-country="usa"]{--tint:rgba(40,80,170,.38)}
.card-photo{position:absolute;inset:0;z-index:0;overflow:hidden;border-radius:inherit;
  background:linear-gradient(170deg,#16305f 0%,var(--tint,#1c2740) 55%,#05070c 100%)}
.card-photo img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;
  transform:scale(1.08);transition:opacity 1.2s ease,transform 1.6s var(--ease-cinema);
  animation:kenBurns 26s ease-in-out infinite alternate;filter:saturate(1.1) contrast(1.05)}
.card-photo img.loaded{opacity:1}.card-photo img.failed{display:none}
.card-photo::after{content:'';position:absolute;inset:0;
  background:linear-gradient(0deg,rgba(5,7,12,.96) 0%,rgba(5,7,12,.55) 42%,rgba(5,7,12,.05) 75%),
             linear-gradient(160deg,var(--tint,transparent),transparent 55%)}
.country-card:hover .card-photo img{animation-play-state:paused}
@keyframes kenBurns{from{transform:scale(1.08) translate3d(-1.5%,0,0)}to{transform:scale(1.18) translate3d(1.5%,-1%,0)}}
.country-card .card-inner{justify-content:flex-end;padding:2rem 1.8rem 1.8rem}
.country-card .card-icon{position:absolute;top:1.4rem;inset-inline-start:1.4rem;width:52px;height:52px;
  background:rgba(5,7,12,.45);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
.country-card .card-icon svg{width:26px;height:26px}
.country-card h2{font-size:2.4rem;text-shadow:0 4px 24px rgba(0,0,0,.6)}
.country-card p{color:#d5d9e2}
.country-card .card-cta{opacity:1;transform:none;margin-top:.6rem;padding:.6rem 1.2rem;border-radius:999px;
  border:1px solid rgba(201,165,92,.5);background:rgba(5,7,12,.4);backdrop-filter:blur(8px);
  transition:background .4s,box-shadow .4s}
.country-card:hover .card-cta{background:rgba(201,165,92,.22);box-shadow:0 0 30px rgba(201,165,92,.3)}
.credits{position:fixed;bottom:.7rem;left:0;right:0;text-align:center;z-index:6;font-size:.66rem;
  color:rgba(141,149,166,.75);padding:0 1rem;pointer-events:none;opacity:0;transition:opacity .6s}
.credits a{color:inherit;text-decoration:underline;pointer-events:auto}
#screen-country.active ~ .credits{opacity:1}
@media (max-width:720px){.country-card{min-height:250px;max-width:100%}.country-card h2{font-size:1.9rem}
  .country-heading{margin-bottom:1.4rem}.country-card .card-inner{padding:1.4rem 1.3rem 1.3rem}}
