/* Trinity V39 — World of Research cinematic entrance
   Replaces the previous "Research Adventure" cinematic with the approved
   desktop/mobile portal-style welcome screen. The underlying storefront and
   all checkout/research functions remain untouched. */

:root{
  --v39-gold:#d9aa57;
  --v39-gold-bright:#f2d18b;
  --v39-red:#c82720;
  --v39-ink:#050302;
  --v39-line:rgba(218,170,87,.62);
}

.tri-v39-world{
  position:fixed;
  inset:0;
  z-index:50000;
  display:none;
  overflow:hidden;
  background:#020101;
  color:#f5eee4;
  opacity:0;
  transform:scale(1.01);
  transition:opacity .55s ease,transform .75s cubic-bezier(.2,.7,.2,1);
  isolation:isolate;
  font-family:Arial,Helvetica,sans-serif;
}
.tri-v39-world.open{
  display:block;
  opacity:1;
  transform:scale(1);
}
.tri-v39-world.is-leaving{
  opacity:0;
  transform:scale(1.012);
  pointer-events:none;
}

.tri-v39-bg,
.tri-v39-smoke,
.tri-v39-embers,
.tri-v39-vignette{
  position:absolute;
  inset:0;
  pointer-events:none;
}
.tri-v39-bg{
  z-index:-5;
  background:
    linear-gradient(90deg,rgba(0,0,0,.68) 0%,rgba(0,0,0,.38) 34%,rgba(0,0,0,.08) 63%,rgba(0,0,0,.22) 100%),
    url('../assets/brand/trinity-v39-world-desktop.jpg') center/cover no-repeat;
  transform:scale(1.02);
}
.tri-v39-smoke{
  z-index:-4;
  background:
    radial-gradient(ellipse at 68% 53%,rgba(255,188,77,.19) 0 4%,rgba(255,155,55,.10) 18%,transparent 48%),
    radial-gradient(ellipse at 62% 78%,rgba(217,57,25,.14),transparent 42%),
    linear-gradient(180deg,rgba(0,0,0,.06),rgba(0,0,0,.45) 90%);
  animation:v39Smoke 7s ease-in-out infinite alternate;
}
.tri-v39-embers{
  z-index:-2;
  opacity:.48;
  background-image:
    radial-gradient(circle at 12% 88%,#ff8a2d 0 1px,transparent 2px),
    radial-gradient(circle at 26% 72%,#f5b54d 0 1px,transparent 2px),
    radial-gradient(circle at 42% 84%,#ff5c25 0 1.2px,transparent 2px),
    radial-gradient(circle at 64% 70%,#f1bc5b 0 1px,transparent 2px),
    radial-gradient(circle at 78% 86%,#ff7024 0 1.2px,transparent 2px),
    radial-gradient(circle at 91% 65%,#efb654 0 1px,transparent 2px);
  background-size:150px 180px,180px 210px,210px 240px,170px 220px,220px 260px,190px 240px;
  animation:v39Embers 9s linear infinite;
}
.tri-v39-vignette{
  z-index:30;
  box-shadow:inset 0 0 130px 42px rgba(0,0,0,.62);
  border:1px solid rgba(212,166,83,.55);
  inset:10px;
}

.tri-v39-topbar{
  position:absolute;
  z-index:25;
  top:10px;
  left:10px;
  right:10px;
  height:80px;
  display:grid;
  grid-template-columns:minmax(200px,285px) 1fr auto;
  align-items:center;
  gap:20px;
  padding:0 24px;
  border-bottom:1px solid rgba(219,171,89,.34);
  background:linear-gradient(180deg,rgba(2,2,2,.78),rgba(2,2,2,.36));
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}
.tri-v39-logo{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  height:68px;
  text-decoration:none;
}
.tri-v39-logo img{
  display:block;
  width:210px;
  max-height:68px;
  object-fit:contain;
  object-position:left center;
  filter:drop-shadow(0 4px 10px rgba(0,0,0,.4));
}
.tri-v39-nav{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:clamp(16px,1.8vw,32px);
  min-width:0;
}
.tri-v39-nav button,
.tri-v39-nav a{
  appearance:none;
  border:0;
  background:transparent;
  padding:8px 0;
  color:#efe9df;
  text-decoration:none;
  text-transform:uppercase;
  font:600 clamp(.58rem,.72vw,.72rem)/1 Arial,sans-serif;
  letter-spacing:.055em;
  white-space:nowrap;
  cursor:pointer;
  transition:color .18s ease,transform .18s ease,text-shadow .18s ease;
}
.tri-v39-nav button:hover,
.tri-v39-nav a:hover,
.tri-v39-nav button:focus-visible,
.tri-v39-nav a:focus-visible{
  color:var(--v39-gold-bright);
  transform:translateY(-1px);
  text-shadow:0 0 12px rgba(237,187,90,.35);
  outline:none;
}
.tri-v39-utility{
  display:flex;
  align-items:center;
  gap:11px;
  padding-left:16px;
  border-left:1px solid rgba(219,171,89,.28);
}
.tri-v39-icon-button{
  position:relative;
  width:34px;
  height:34px;
  display:grid!important;
  place-items:center;
  border:0!important;
  background:transparent!important;
  color:#e9dfcf!important;
  cursor:pointer;
}
.tri-v39-icon-button svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.tri-v39-cart-count{
  position:absolute;
  right:-5px;
  top:-4px;
  min-width:17px;
  height:17px;
  padding:0 4px;
  display:grid;
  place-items:center;
  border-radius:99px;
  background:#a61816;
  color:white;
  font:700 10px/1 Arial,sans-serif;
}
.tri-v39-skip{
  position:absolute;
  z-index:35;
  top:102px;
  right:24px;
  appearance:none;
  border:1px solid rgba(218,170,87,.44);
  background:rgba(4,3,2,.45);
  color:#dfc58d;
  border-radius:3px;
  padding:8px 13px;
  font:700 10px/1 Arial,sans-serif;
  letter-spacing:.1em;
  text-transform:uppercase;
  cursor:pointer;
  transition:background .2s ease,border-color .2s ease,color .2s ease;
}
.tri-v39-skip:hover{background:rgba(218,170,87,.10);border-color:rgba(242,209,139,.72);color:#f4deb1}

.tri-v39-stage{
  position:absolute;
  z-index:5;
  top:90px;
  left:10px;
  right:10px;
  bottom:186px;
  overflow:hidden;
}
.tri-v39-copy{
  position:absolute;
  z-index:8;
  left:8.8%;
  top:21%;
  width:min(520px,38vw);
  text-align:center;
}
.tri-v39-kicker{
  margin:0 0 7px;
  color:var(--v39-gold-bright);
  font:600 clamp(.82rem,1.25vw,1.16rem)/1.2 Georgia,'Times New Roman',serif;
  letter-spacing:.14em;
  text-transform:uppercase;
}
.tri-v39-title{
  margin:0;
  color:#fff;
  font-family:Georgia,'Times New Roman',serif;
  font-weight:500;
  line-height:.88;
  text-transform:uppercase;
  text-shadow:0 3px 20px rgba(0,0,0,.52);
}
.tri-v39-title .tri-v39-enter{
  display:block;
  margin-bottom:2px;
  color:#efdfbf;
  font-size:clamp(1rem,1.55vw,1.42rem);
  letter-spacing:.16em;
}
.tri-v39-title .tri-v39-world-word{
  display:block;
  font-size:clamp(4.1rem,7.1vw,7rem);
  letter-spacing:.02em;
}
.tri-v39-title .tri-v39-of-research{
  display:block;
  color:#d8a24f;
  font-size:clamp(2.1rem,3.75vw,3.85rem);
  letter-spacing:.02em;
  margin-top:5px;
}
.tri-v39-divider{
  width:78%;
  height:18px;
  margin:17px auto 12px;
  position:relative;
}
.tri-v39-divider::before,
.tri-v39-divider::after{
  content:"";
  position:absolute;
  top:50%;
  width:42%;
  height:1px;
  background:linear-gradient(90deg,transparent,var(--v39-gold));
}
.tri-v39-divider::before{left:0}
.tri-v39-divider::after{right:0;transform:scaleX(-1)}
.tri-v39-divider span{
  position:absolute;
  left:50%;top:50%;
  transform:translate(-50%,-52%);
  color:#b51c18;
  font:700 24px/1 Georgia,serif;
}
.tri-v39-lede{
  margin:0 auto;
  color:rgba(244,238,230,.88);
  font:400 clamp(.82rem,1vw,1rem)/1.5 Arial,sans-serif;
  letter-spacing:.015em;
  max-width:38ch;
}

.tri-v39-portal-glow{
  position:absolute;
  z-index:1;
  left:64%;
  top:11%;
  width:36vw;
  max-width:620px;
  aspect-ratio:.66;
  transform:translateX(-50%);
  border-radius:50% 50% 8% 8%/42% 42% 4% 4%;
  background:radial-gradient(circle at 50% 20%,rgba(255,244,191,.42) 0 3%,rgba(255,188,71,.22) 9%,rgba(229,119,37,.10) 28%,transparent 66%);
  filter:blur(12px);
  opacity:.9;
  animation:v39PortalPulse 4.6s ease-in-out infinite;
}
.tri-v39-knight{
  position:absolute;
  z-index:5;
  left:64%;
  bottom:-10%;
  transform:translateX(-50%);
  height:112%;
  width:auto;
  max-width:46vw;
  object-fit:contain;
  object-position:center bottom;
  filter:drop-shadow(0 20px 22px rgba(0,0,0,.7)) drop-shadow(0 0 20px rgba(205,74,28,.18));
  animation:v39Knight 4.2s ease-in-out infinite;
}

.tri-v39-progress-panel{
  position:absolute;
  z-index:20;
  left:55%;
  bottom:122px;
  width:min(610px,46vw);
  transform:translateX(-35%);
  padding:14px 26px 11px;
  background:linear-gradient(180deg,rgba(8,5,3,.90),rgba(2,2,2,.76));
  border:1px solid rgba(218,170,87,.45);
  box-shadow:0 12px 40px rgba(0,0,0,.42),inset 0 0 0 1px rgba(122,66,22,.24);
}
.tri-v39-progress-panel::before,
.tri-v39-progress-panel::after{
  content:"";
  position:absolute;
  width:22px;height:22px;
  border-color:var(--v39-gold);
  opacity:.7;
}
.tri-v39-progress-panel::before{left:-1px;top:-1px;border-left:2px solid;border-top:2px solid}
.tri-v39-progress-panel::after{right:-1px;bottom:-1px;border-right:2px solid;border-bottom:2px solid}
.tri-v39-progress-label{
  margin:0 0 8px;
  text-align:center;
  color:#e3bb70;
  font:500 15px/1.1 Georgia,'Times New Roman',serif;
  letter-spacing:.1em;
  text-transform:uppercase;
}
.tri-v39-progress-track{
  position:relative;
  height:12px;
  border:1px solid rgba(222,176,91,.70);
  border-radius:999px;
  background:#130805;
  box-shadow:inset 0 1px 6px rgba(0,0,0,.9);
  overflow:visible;
}
.tri-v39-progress-fill{
  position:absolute;
  left:2px;top:2px;bottom:2px;
  width:0%;
  border-radius:999px;
  background:linear-gradient(90deg,#6f0707 0%,#c71812 42%,#ee3e1d 78%,#f3b94e 100%);
  box-shadow:0 0 12px rgba(230,49,22,.8),0 0 24px rgba(232,135,41,.32);
  transition:width .72s cubic-bezier(.2,.75,.2,1);
}
.tri-v39-progress-fill::after{
  content:"";
  position:absolute;
  right:-5px;
  top:50%;
  width:11px;height:11px;
  transform:translateY(-50%);
  border-radius:50%;
  background:#fff2b3;
  box-shadow:0 0 10px 4px #f5b846,0 0 22px 7px rgba(239,83,22,.78);
}
.tri-v39-progress-number{
  margin:8px 0 0;
  text-align:center;
  color:#fff;
  font:600 14px/1 Arial,sans-serif;
}

.tri-v39-principles{
  position:absolute;
  z-index:18;
  left:4.5%;
  right:4.5%;
  bottom:42px;
  min-height:76px;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:0;
  border-top:1px solid rgba(218,170,87,.24);
  background:linear-gradient(180deg,rgba(0,0,0,.08),rgba(0,0,0,.38));
}
.tri-v39-principle{
  display:grid;
  grid-template-columns:48px 1fr;
  gap:12px;
  align-items:center;
  padding:12px 22px;
  border-right:1px solid rgba(218,170,87,.22);
}
.tri-v39-principle:last-child{border-right:0}
.tri-v39-principle svg{
  width:38px;height:38px;
  fill:none;
  stroke:#d6a654;
  stroke-width:1.5;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.tri-v39-principle strong{
  display:block;
  margin-bottom:4px;
  color:#dfb66d;
  font:500 13px/1 Georgia,serif;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.tri-v39-principle span{
  display:block;
  color:rgba(245,239,231,.72);
  font:400 11px/1.35 Arial,sans-serif;
}
.tri-v39-motto{
  position:absolute;
  z-index:22;
  left:10px;right:10px;bottom:10px;
  height:32px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#d2ad68;
  font:500 12px/1 Georgia,serif;
  letter-spacing:.17em;
  text-transform:uppercase;
  border-top:1px solid rgba(218,170,87,.28);
}
.tri-v39-motto b{color:#9e1615;margin:0 12px;font-size:18px}

@keyframes v39PortalPulse{0%,100%{opacity:.72;transform:translateX(-50%) scale(.97)}50%{opacity:1;transform:translateX(-50%) scale(1.035)}}
@keyframes v39Knight{0%,100%{transform:translateX(-50%) translateY(0)}50%{transform:translateX(-50%) translateY(-6px)}}
@keyframes v39Smoke{from{transform:scale(1) translate3d(0,0,0)}to{transform:scale(1.03) translate3d(1%,-.4%,0)}}
@keyframes v39Embers{from{background-position:0 0,20px 10px,40px 0,10px 20px,30px 10px,50px 0}to{background-position:20px -200px,50px -230px,70px -260px,40px -240px,60px -280px,80px -260px}}

/* Tablet */
@media (max-width:980px){
  .tri-v39-topbar{grid-template-columns:180px 1fr auto;padding:0 16px}
  .tri-v39-logo img{width:165px}
  .tri-v39-nav{gap:12px}
  .tri-v39-nav button,.tri-v39-nav a{font-size:.55rem}
  .tri-v39-copy{left:5%;width:42vw}
  .tri-v39-knight{left:67%;max-width:50vw}
  .tri-v39-progress-panel{left:58%;width:50vw}
  .tri-v39-principle{padding:10px 12px;grid-template-columns:38px 1fr;gap:8px}
  .tri-v39-principle svg{width:31px;height:31px}
  .tri-v39-principle span{font-size:10px}
}

/* Mobile cinematic page */
@media (max-width:700px){
  .tri-v39-world{
    min-height:100svh;
    overflow:hidden;
  }
  .tri-v39-bg{
    background:
      linear-gradient(180deg,rgba(0,0,0,.58) 0%,rgba(0,0,0,.38) 34%,rgba(0,0,0,.10) 58%,rgba(0,0,0,.34) 100%),
      url('../assets/brand/trinity-v39-world-mobile.jpg') center/cover no-repeat;
  }
  .tri-v39-vignette{inset:5px;box-shadow:inset 0 0 72px 26px rgba(0,0,0,.65)}
  .tri-v39-topbar{
    top:5px;left:5px;right:5px;
    height:92px;
    display:flex;
    justify-content:center;
    padding:4px 16px 0;
    border-bottom:0;
    background:linear-gradient(180deg,rgba(0,0,0,.73),transparent);
    backdrop-filter:none;
  }
  .tri-v39-logo{height:84px;justify-content:center}
  .tri-v39-logo img{width:164px;max-height:82px;object-position:center}
  .tri-v39-nav,.tri-v39-utility{display:none}
  .tri-v39-skip{
    position:absolute;
    top:15px;right:12px;
    z-index:35;
    padding:7px 9px;
    font-size:8px;
    background:rgba(0,0,0,.42);
  }
  .tri-v39-stage{top:92px;left:5px;right:5px;bottom:142px}
  .tri-v39-copy{
    left:18px;right:18px;top:4%;
    width:auto;
    text-align:center;
  }
  .tri-v39-kicker{
    font-size:12px;
    letter-spacing:.15em;
    margin-bottom:4px;
  }
  .tri-v39-title{line-height:.93}
  .tri-v39-title .tri-v39-enter{font-size:13px;letter-spacing:.16em;margin-bottom:4px}
  .tri-v39-title .tri-v39-world-word{font-size:clamp(42px,13.8vw,60px);letter-spacing:.01em}
  .tri-v39-title .tri-v39-of-research{font-size:clamp(26px,8vw,36px);margin-top:1px}
  .tri-v39-divider{width:72%;height:13px;margin:10px auto 7px}
  .tri-v39-divider span{font-size:17px}
  .tri-v39-lede{font-size:12px;line-height:1.48;max-width:30ch}
  .tri-v39-portal-glow{
    left:50%;top:34%;width:82vw;max-width:none;
    opacity:.73;
  }
  .tri-v39-knight{
    left:50%;
    bottom:-8%;
    height:min(60vh,620px);
    max-width:92vw;
    animation-duration:4.8s;
  }
  .tri-v39-progress-panel{
    left:18px;right:18px;bottom:58px;
    width:auto;
    transform:none;
    padding:10px 16px 9px;
  }
  .tri-v39-progress-label{font-size:11px;margin-bottom:7px}
  .tri-v39-progress-track{height:9px}
  .tri-v39-progress-number{font-size:11px;margin-top:6px}
  .tri-v39-principles{display:none}
  .tri-v39-motto{
    bottom:9px;left:12px;right:12px;height:36px;
    font-size:9px;
    letter-spacing:.11em;
    border-top:1px solid rgba(218,170,87,.20);
  }
  .tri-v39-motto b{font-size:12px;margin:0 6px}
}

@media (max-width:430px){
  .tri-v39-topbar{height:84px}
  .tri-v39-logo{height:76px}
  .tri-v39-logo img{width:148px;max-height:74px}
  .tri-v39-stage{top:84px;bottom:138px}
  .tri-v39-copy{top:2%}
  .tri-v39-title .tri-v39-world-word{font-size:clamp(38px,13vw,54px)}
  .tri-v39-title .tri-v39-of-research{font-size:clamp(24px,7.8vw,32px)}
  .tri-v39-lede{font-size:11px}
  .tri-v39-knight{height:min(58vh,560px);bottom:-7%}
  .tri-v39-progress-panel{bottom:55px}
}

@media (max-height:700px) and (max-width:700px){
  .tri-v39-logo img{width:124px}
  .tri-v39-topbar{height:68px}
  .tri-v39-stage{top:68px;bottom:120px}
  .tri-v39-copy{top:0}
  .tri-v39-title .tri-v39-world-word{font-size:38px}
  .tri-v39-title .tri-v39-of-research{font-size:24px}
  .tri-v39-divider{margin:7px auto 5px}
  .tri-v39-lede{font-size:10px;line-height:1.35}
  .tri-v39-knight{height:54vh}
  .tri-v39-progress-panel{bottom:45px}
  .tri-v39-motto{height:28px;font-size:8px}
}

@media (prefers-reduced-motion:reduce){
  .tri-v39-smoke,.tri-v39-embers,.tri-v39-portal-glow,.tri-v39-knight{animation:none!important}
  .tri-v39-progress-fill{transition:width .18s linear}
}
